perm_128_256_spbc=[3150.65,2949.27,2084.12,3443.79,2175.15,3615.8,2022.53,3675.81];
perm_128_256_mpbc=[5070.46,4989.59,3300.63,4349.06,3915.68,5455.57,3743.23,5154.02];
perm_128_256_buf=[4588.79,4482.09,3127.62,4210.85,3649.31,5061.78,3428.23,4924.84];

per_64_128_spbc=[1678.05,1349.73,2330.04,2056.85,2356.03,73429.4,2622.04,4603.32];
per_64_128_mpbc=[9071.68,1731.25,3071.53,2960.6,3872.08,81304.2,3195.61,9376.01];
per_64_128_buf=[6692.27,1786.88,3104.13,2993.66,3681.76,78543.3,3238.59,8210.52];

por_128=[0.252285,0.227462,0.236506,0.237704,0.233534,0.239399,0.23151,0.258315];
por_64=[0.275288,0.246094,0.208519,0.192307,0.240921,0.448952,0.266598,0.268364];


perm_128_256_spbc=[por_128;perm_128_256_spbc];
perm_128_256_mpbc=[por_128;perm_128_256_mpbc];
perm_128_256_buf=[por_128;perm_128_256_buf];

per_64_128_spbc=[por_64;per_64_128_spbc];
per_64_128_mpbc=[por_64;per_64_128_mpbc];
per_64_128_buf=[por_64;per_64_128_buf];


per_from_512_128=[5362.83 0.252285
5685.08 0.227462
4060.37 0.236506
4745.79 0.237704
4215.85 0.233534
4799.37 0.239399
3831.3 0.23151
5117.34 0.258315]';

per_from_512_64=[6245.45 0.274715
6035.87 0.247696
5143.32 0.212475
4884.47 0.186867
3610.87 0.237259
10697.3 0.449741
4916.91 0.267128
6274.05 0.270332]';

per_from_512_64(2,:)=por_64;

[perm_128_buf,IX_128_buf]=sort(perm_128_256_buf,2);
[perm_128_spbc,IX_128_spbc]=sort(perm_128_256_spbc,2);
[perm_128_mpbc,IX_128_mpbc]=sort(perm_128_256_mpbc,2);

[perm_64_buf,IX_64_buf]=sort(per_64_128_buf,2);
[perm_64_spbc,IX_64_spbc]=sort(per_64_128_spbc,2);
[perm_64_mpbc,IX_64_mpbc]=sort(per_64_128_mpbc,2);

[Perm_f512_128,IX_128_f]=sort(per_from_512_128,2);
[Perm_f512_64,IX_64_f]=sort(per_from_512_64,2);



[perm_128_buf,IX_128_buf]=sort(perm_128_256_buf,2);
[perm_128_spbc,IX_128_spbc]=sort(perm_128_256_spbc,2);
[perm_128_mpbc,IX_128_mpbc]=sort(perm_128_256_mpbc,2);

[perm_64_buf,IX_64_buf]=sort(per_64_128_buf,2);
[perm_64_spbc,IX_64_spbc]=sort(per_64_128_spbc,2);
[perm_64_mpbc,IX_64_mpbc]=sort(per_64_128_mpbc,2);

[Perm_f512_128,IX_128_f]=sort(per_from_512_128,2);
[Perm_f512_64,IX_64_f]=sort(per_from_512_64,2);


figure
plot (perm_128_256_buf(1,IX_128_buf(1,:)),perm_128_256_buf(2,IX_128_buf(1,:)),'r-*');
hold on
plot (perm_128_256_spbc(1,IX_128_spbc(1,:)),perm_128_256_spbc(2,IX_128_spbc(1,:)),'b-*');
hold on
plot (perm_128_256_mpbc(1,IX_128_mpbc(1,:)),perm_128_256_mpbc(2,IX_128_mpbc(1,:)),'k-*');
hold on 

plot (per_from_512_128(2,IX_128_f(2,:)),per_from_512_128(1,IX_128_f(2,:)),'g-*');

legend('buffer BC','Simple PBC', 'Mirror PBC', 'from 512');
hold off

figure
plot (per_64_128_buf(1,IX_64_buf(1,:)),per_64_128_buf(2,IX_64_buf(1,:)),'r-*');
hold on
plot (per_64_128_spbc(1,IX_64_spbc(1,:)),per_64_128_spbc(2,IX_64_spbc(1,:)),'b-*');
hold on

plot (per_64_128_mpbc(1,IX_64_mpbc(1,:)),per_64_128_mpbc(2,IX_64_mpbc(1,:)),'k-*');
hold on 
plot (per_from_512_64(2,IX_64_f(2,:)),per_from_512_64(1,IX_64_f(2,:)),'g-*');
legend('buffer BC','Simple PBC', 'Mirror PBC', 'from 512');
%legend('buffer BC','Simple PBC', 'Mirror PBC');


hold off


figure

plot (per_64_128_buf(1,IX_64_buf(1,1:7)),per_64_128_buf(2,IX_64_buf(1,1:7)),'r-*');
hold on
plot (per_64_128_spbc(1,IX_64_spbc(1,1:7)),per_64_128_spbc(2,IX_64_spbc(1,1:7)),'b-*');
hold on

plot (per_64_128_mpbc(1,IX_64_mpbc(1,1:7)),per_64_128_mpbc(2,IX_64_mpbc(1,1:7)),'k-*');
hold on 
plot (per_from_512_64(2,IX_64_f(2,1:7)),per_from_512_64(1,IX_64_f(2,1:7)),'g-*');
legend('buffer BC','Simple PBC', 'Mirror PBC', 'from 512');



hold off


%=====================================================
perm_64=[4832.33 0.270226
6978.58 0.199898
3060.51 0.107903
8602.11 0.262466
4766.4 0.23901
5179.19 0.230186
6335.26 0.262932
2749.13 0.234829
6137.24 0.233147
3097.08 0.206818
3221.46 0.1236
5981.79 0.320965
4002.08 0.288551
4544.5 0.275078
3187.38 0.183346
7989.68 0.432709
6811.69 0.298077
3983.51 0.218384
5910.21 0.217281
8486.45 0.26207
3631.59 0.273392
6252.44 0.274715
6043.92 0.247696
5057.01 0.234062
3921.2 0.211979
5151.4 0.212475
4891.41 0.186867
4750.88 0.262932
3161.82 0.218018
2599.35 0.250481
3611.74 0.21117
3810.81 0.185066
4597.39 0.215431
3793.33 0.235588
3561.95 0.275417
3648.36 0.274456
4874.15 0.253235
3615.07 0.237259
10710.5 0.449741
2331.63 0.129467
2709.97 0.234276
4921.38 0.267128
6282.31 0.270332
8036.78 0.27087
1893.04 0.151928
4036.03 0.264545
3744.21 0.277897
3369.43 0.232529
3294.2 0.197479
3319.08 0.18478
2937.03 0.194668
1953.49 0.156292
2907.04 0.204952
7436.54 0.339642
7311.98 0.246723
5695.68 0.179111
1704.3 0.11681
6194.32 0.299675
5076.68 0.252365
6909.06 0.267399
3321.32 0.256687
5484.04 0.253834
3325.9 0.221439
4189.25 0.277622]';


perm_128=[5304.47 0.250486
5780.58 0.228655
4076.83 0.237068
4680.64 0.238332
4229.6 0.233546
4768.83 0.238235
3783.05 0.23061
5116.7 0.258807]';

perm_256=[4713.84 0.239467]';

perm_512=[4747.47 0.236794]';


[Perm_64,IX_64]=sort(perm_64,2);
[Perm_128,IX_128]=sort(perm_128,2);
[Perm_256,IX_256]=sort(perm_256,2);


figure
plot (perm_64(2,IX_64(2,:)),perm_64(1,IX_64(2,:)),'*--b');
hold on
plot (perm_128(2,IX_128(2,:)),perm_128(1,IX_128(2,:)),'-gs');
hold on
plot (perm_256(2,IX_256(2,:)),perm_256(1,IX_256(2,:)),'kd');
hold on
plot (perm_512(2,:),perm_512(1,:),'r^');
legend('64^3','128^3','256^3','512^3');
hold off
